<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="/navbar::header(全部电影)">
</head>
<body>
<!--导航栏-->
<nav th:replace="/navbar::naver"></nav>
<!--内容-->
<div class="search-wrapper">
    <div class="container container--add">
        <br>
    <form class="search" th:action="@{/movie/by}" th:method="post">
        <input class="search__field" placeholder="输入关键词，开始查询" style="width: 60%;margin-left: 15%" th:name="name" th:type="text"/>
        <button class="btn btn-md btn--danger search__button" style="margin-right: 18%" type="submit">查找电影</button>
    </form>
</div>
</div>
<div class="container">
    <br>
    <h2 class="page-heading">w-movie</h2>
    <hr>
    <h6 style="display: block;color: red;width: 50px;float: left;margin-top: 2px;text-align: center">地区: </h6>
    <a class="aa" th:href="@{/movie/sy(region='')}">全部</a>
    <a class="aa" th:href="@{/movie/sy(region='美国')}">美国</a>
    <a class="aa" th:href="@{/movie/sy(region='大陆')}">大陆</a>
    <a class="aa" th:href="@{/movie/sy(region='香港')}">香港</a>
    <a class="aa" th:href="@{/movie/sy(region='日本')}">日本</a>
    <br>
    <h6 style="display: block;color: red;width: 50px;float: left;margin-left: -4.3%;margin-top: 2px;text-align: center">类型: </h6>
    <a class="aa" th:href="@{/movie/sy(types='')}">全部</a>
    <a class="aa" th:href="@{/movie/sy(types='科幻')}">科幻</a>
    <a class="aa" th:href="@{/movie/sy(types='爱情')}">爱情</a>
    <a class="aa" th:href="@{/movie/sy(types='悬疑')}">悬疑</a>
    <a class="aa" th:href="@{/movie/sy(types='动作')}">动作</a>
    <a class="aa" th:href="@{/movie/sy(types='文艺')}">文艺</a>
    <a class="aa" th:href="@{/movie/sy(types='搞笑')}">搞笑</a>
    <a class="aa" th:href="@{/movie/sy(types='剧情')}">剧情</a>
    <a class="aa" th:href="@{/movie/sy(types='动画')}">动画</a>
    <a class="aa" th:href="@{/movie/sy(types='恐怖')}">恐怖</a>
    <a class="aa" th:href="@{/movie/sy(types='科幻')}">犯罪</a>
    <br>
    <h6 style="display: block;color: red;width: 50px;float: left;margin-top: 2px;text-align: center">年份: </h6>
    <a class="aa" th:href="@{/movie/sy(onlin='')}">全部</a>
    <a class="aa" th:href="@{/movie/sy(onlin='2022')}">2022</a>
    <a class="aa" th:href="@{/movie/sy(onlin='2021')}">2021</a>
    <br>
    <hr>
    <br>
</div>
<div class="container movie" th:each="movie:${page.getRecords()}">
    <div class="dy1">
        <div class="movie__images" style="width: 170px;height: 250px;margin-top: 1%">
            <img alt="" style="width: 170px;height: 250px" th:src="@{/static/img/upload/} + ${movie.img}"/>
        </div>
        <div class="bq">
            <a class="movie__title link--huge" th:href="@{/movie/detailed(id=${movie.mId})}" th:text="${movie.name}"></a>
            <p class="movie__time" th:text="${movie.duration}+'  min'"></p>
            <p class="movie__option" th:text="'地区:  '+${movie.region}"></p>
            <p class="movie__option" th:text="'类型:  '+${movie.types}"></p>
            <p class="movie__option" th:text="'上映时间:  '+${movie.onlin}"></p>
            <p class="movie__option" th:text="'价格:  '+${movie.price}"></p>
        </div>
        <div class="movie__btns">
            <a class="btn btn-md btn--warning" th:href="@{/movie/buy(id=${movie.mId})}">购买电影</a>
        </div>
    </div>
    <hr>
    <br>
</div>
        <div class="pagination sx">
            <th:block th:if="${page.current>1}">
                <a class="pagination__prev" th:href="@{/movie(i=${page.getCurrent()-1})}">上一页</a>
            </th:block>
            <th:block th:if="${page.current==1}">
                <a class="pagination__prev" href="#" onclick="(confirm(`好兄弟到顶啦`))">上一页</a>
            </th:block>
            <th:block th:if="${page.getCurrent}==${page.getPages()}">
                <a class="pagination__next" href="#" onclick="(confirm(`好兄弟到底啦`))">下一页</a>
            </th:block>
            <th:block th:if="${page.getCurrent}!=${page.getPages()}">
                <a class="pagination__next" th:href="@{movie(i=${page.getCurrent()+1})}">下一页</a>
            </th:block>
        </div>


<!--页尾-->
<footer th:replace="/navbar::footer"></footer>
</body>
</html>